<!DOCTYPE html>
<html lang="en">
<head>
	<meta charset="UTF-8">
	<title>IE兼容canvas</title>
	<style>
		#can {
			width:200px;
			height:200px;
			border: 1px solid #ccc;
		}
	</style>
	<!--[if lte IE 8]> 
	<script type="text/javascript" src="script/excanvas.js"></script>
	<![endif]-->
</head>
<body>
	<canvas id="can"></canvas>
	<script>
		function haha() {
			var canvas = document.getElementById('can'),
				context = canvas.getContext('2d');
			context.beginPath();
			context.moveTo(10, 10);
			context.lineTo(100,100);
			context.stroke();
		}
		setTimeout(haha, 2000);
	</script>
</body>
</html>